package com.pw.study.flink.transfrom

import com.pw.study.flink.entities.UserBean
import org.apache.flink.api.common.functions.RichFlatMapFunction
import org.apache.flink.configuration.Configuration
import org.apache.flink.util.Collector

import scala.collection.mutable.ArrayBuffer

class MyFlatMap extends RichFlatMapFunction[ArrayBuffer[UserBean],UserBean]{
  override def open(parameters: Configuration): Unit = {
    println("open.............")

  }
  override def flatMap(in: ArrayBuffer[UserBean], collector: Collector[UserBean]): Unit = {
    for (elem <- in) {
      collector.collect(elem)
    }
    println("flaMap.......")
  }

  override def close(): Unit = {
    println("close..............")

  }
}
